<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Redirect Loading</title>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-R3WC07G3GB"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-R3WC07G3GB');
  gtag("event", "redirect", {
    url: location.pathname
  });
</script>
</head>
<body>
  <script>
    var paths = location.pathname.split('/').filter(item => item != '');
    var maptoLast = {
      'tensorflow~cpp': 'tensorflow_cpp~1.15',
      'cakephp~3.8': 'cakephp~4.1',
      'angular~7': 'angular~10',
      'angularjs~1.7': 'angularjs~1.8',
      'ruby~2.6': 'ruby~2.7',
      'laravel~5.7': 'laravel~5.8',
      'clojure~1.9': 'clojure~1.10',
      'cmake~3.15': 'cmake~3.19',
      'codeigniter~3': 'codeigniter~4',
      'crystal~0.31': 'crystal',
      'elixir~1.9': 'elixir~1.11',
      'falcon~1.4': 'falcon~2.0',
      'fish~3.0': 'fish~3.1',
      'gcc~9': 'gcc~10',
      'gcc~9_cpp': 'gcc~10_cpp',
      'gnu_fortran~7': 'gnu_fortran~10',
      'godot~3.1': 'godot~3.2',
      'leaflet~1.6': 'leaflet~1.7',
      'openjdk~8': 'openjdk~11',
      'postgresql~12': 'postgresql~13',
      'python~3.8': 'python~3.9',
      'qt~5.13': 'qt~5.15',
      'rails~5.0': 'rails~6.0',
      'jekyll': 'jekyll~4'
    }
    var origin = location.origin;
    var pathname = location.pathname;
    if (paths && paths.length) {
      var slug = paths[0]
      var href = '';
      if (paths.length > 1) {
        // detail url
        // fix url
        if (location.href.lastIndexOf('/') == location.href.length - 1) {
          if (maptoLast[slug]) {
            // get map
            href = `${origin}/${maptoLast[slug]}/` + paths.slice(1).join('/') + location.search + location.hash;
          } else {
            href =  `${origin}` + pathname.slice(0, -1) + location.search + location.hash;
          }
        } else {
          if (maptoLast[slug]) {
            // get map
            href = `${origin}/${maptoLast[slug]}/` + paths.slice(1).join('/') + location.search + location.hash;
          } else {
            href = `${origin}/${paths[0]}/`;
          }
        }
      } else {
        // doc root
        if (maptoLast[slug]) {
          // get map
          href = `${origin}/${maptoLast[slug]}/`;
        } else {
          href = `${origin}/`;
        }
      }
      location.href = href;
    }
  </script>
</body>

</html>